<template>
    <div class="cont">
        <CustomForm @submit="submit" title="添加管理员" :formList="formList"></CustomForm>
    </div>
</template>

<script setup lang="ts">
import CustomForm from '@/components/customForm/CustomForm.vue';
import { CustomFormItem, CustomFormState } from '@/components/customForm/types';

const formList = reactive<CustomFormItem[]>([
    {label: '账户名称',key: 'titleOfAccount',type:'input',required:true},
    {label: '真实姓名',key: 'name',type:'input',required:true},
    {label: '手机号',key: 'phone',type: 'input',required:true},
    {value: '提交并保存',key:'submit',type: 'submit'}
])

const submit = (formState: CustomFormState) => {
    alert('表单结果为' + JSON.stringify(formState))
}
</script>

<style scoped>

</style>